package com.jilefojing.beans.pojos.enhanced;

import java.util.Date;
import java.util.List;

import com.jilefojing.beans.enums.ItemTypeEnumForSource;
import com.jilefojing.beans.pojos.DCategory;
import com.jilefojing.beans.pojos.enhanced.base.BaseEnhanced;

/**
 * 
 * @author 作者 jgshun
 * @date 创建时间 2016年07月26日 16时31分05秒
 */
public class EnhancedDCategory extends BaseEnhanced {
	public EnhancedDCategory(DCategory dCategory) {
		// TODO 自动生成 细微误差自己调整
		if (dCategory.getId() != null) {
			this.id = dCategory.getId();
		}

		if (dCategory.getItemType() != null) {
			this.itemType = ItemTypeEnumForSource.getItemTypeEnumByCode(dCategory.getItemType());
		}

		this.name = dCategory.getName();
		if (dCategory.getParentId() != null) {
			EnhancedDCategory enhancedDCategory = new EnhancedDCategory();
			enhancedDCategory.setId(dCategory.getParentId());
			this.enhancedParentDCategory = enhancedDCategory;
		}
		if (dCategory.getEntity() != null && dCategory.getEntity() == 1) {
			this.entity = true;
		}
		this.createTime = dCategory.getCreateTime();
		this.updateTime = dCategory.getUpdateTime();
		if (dCategory.getCreateUser() != null) {
			EnhancedUser _EnhancedCreateUser = new EnhancedUser();
			_EnhancedCreateUser.setId(dCategory.getCreateUser());
			this.enhancedCreateUser = _EnhancedCreateUser;
		}
		this.ckey = dCategory.getCkey();
		if (dCategory.getSort() != null) {
			this.sort = dCategory.getSort();
		}
	}

	public EnhancedDCategory() {
	}

	private long id;
	private String name;
	private EnhancedDCategory enhancedParentDCategory;
	private boolean entity;
	private Date createTime;
	private Date updateTime;
	private EnhancedUser enhancedCreateUser;
	private ItemTypeEnumForSource itemType;
	private List<EnhancedDCategory> enhancedChildDCategories;
	private String ckey;
	private double sort;

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public EnhancedDCategory getEnhancedParentDCategory() {
		return enhancedParentDCategory;
	}

	public void setEnhancedParentDCategory(EnhancedDCategory enhancedParentDCategory) {
		this.enhancedParentDCategory = enhancedParentDCategory;
	}

	public boolean isEntity() {
		return entity;
	}

	public void setEntity(boolean entity) {
		this.entity = entity;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public EnhancedUser getEnhancedCreateUser() {
		return enhancedCreateUser;
	}

	public void setEnhancedCreateUser(EnhancedUser enhancedCreateUser) {
		this.enhancedCreateUser = enhancedCreateUser;
	}

	public ItemTypeEnumForSource getItemType() {
		return itemType;
	}

	public void setItemType(ItemTypeEnumForSource itemType) {
		this.itemType = itemType;
	}

	public List<EnhancedDCategory> getEnhancedChildDCategories() {
		return enhancedChildDCategories;
	}

	public void setEnhancedChildDCategories(List<EnhancedDCategory> enhancedChildDCategories) {
		this.enhancedChildDCategories = enhancedChildDCategories;
	}

	public String getCkey() {
		return ckey;
	}

	public void setCkey(String ckey) {
		this.ckey = ckey;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public double getSort() {
		return sort;
	}

	public void setSort(double sort) {
		this.sort = sort;
	}

}